<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <!--直接引入less文件-->
    <!--<link rel="stylesheet/less" href="./css/index.less">
    &lt;!&ndash;引入能够解析less文件的js插件&ndash;&gt;
    <script src="./js/less.js"></script>-->
    <link rel="stylesheet" href="css/base.css">
    <script src="js/jquery.min.js"></script>
    <title>优惠活动</title>


    <style>
        .navTop img{
            width: 100%;
            display: block;
            height: 1.28rem;

        }
    </style>
</head>
<body>
<div class="layout">
    <div class="navTop">
        <img src="./images/topnav.png" alt="">
    </div>
    <div class="items">
        <div class="title">
            <h4>全场优惠</h4>
            <span>0/1</span>
        </div>
        <div class="item">
            <a href="javascript:;" class="icon-add">
                <span>添加优惠</span>
            </a>
        </div>
        <div class="title">
            <h4>全场优惠</h4>
            <span>0/1</span>
        </div>
        <div class="item" id="aa">
            <a href="javascript:;" class="icon-add">
                <span>添加优惠</span>
            </a>
        </div>
    </div>
    <div class="tips" ></div>
</div>
</body>
<script>


    function size(){
        /* 1、获取设备宽度
         2、设备的宽度和设计稿之间存在一个比值
         3、比值添加到html {font-size:比值}*/

        var width=$(window).width();
        /*/640是根据设计稿的大小来决定的，如果是750 ，就除以750*/
        var size=(width/640)*100;
        /*max-width:640px;
         1、在0-640就直接获取size，
         2、超出就等于一个固定值100px*/
        document.documentElement.style.fontSize=(size<100?size:100)+'px';
    }
    size();
</script>
</html>